{layout name="public/layout" /}
        {include file='yxnavbar'}
<div class="main">
    <ul class="nav nav-tabs">
    	<li><a href="{php echo createWebUrl('giftgroup');}">礼品/商家--分组管理</a></li>
        <li><a href="{php echo createWebUrl('gift',array('giftgroupid'=>$giftgroupid));}">分组明细</a></li>
        <li class="active"><a href="{php echo createWebUrl('addgift',array('giftgroupid'=>$giftgroupid));}">添加礼品/商家</a></li>
    </ul>
</div>       
<style>
.table td span{display:inline-block;margin-top:4px;}
.table td input{margin-bottom:0;}
.display {display:block;}
</style>
<div class="clearfix">
<form class="form-horizontal form" action="" method="post" enctype="multipart/form-data">
    <div class="panel panel-default">
        <div class="panel-heading">通用信息</div>
        <div class="panel-body">
                <input type="hidden" name="giftid" value="{$gift['id']}">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">排序</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control"  placeholder="例如：1" name="displayorder"  value="{$gift['displayorder']}">
                    	<span class="help-block">填正整数，数字越小排序越靠前</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>礼品/商家名称</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="giftname" value="{$gift['giftname']}">
                        {if $system['fanpai']==1}
                        <span class="help-block">空奖名称必须用：未中奖</span>
                        {/if}
                    </div>
                </div>           
               
                {if $system['fanpai']==1}
                    <div class="form-group display">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>奖品图片</label>
                        <div class="col-sm-8 col-xs-12">
                           {php echo view_form_field_image('giftimg',$gift['giftimg']);}
                        <span class="help-block">像素381*510 <a style="color: #000000" href="https://css2019.yixuan.net/2019css/fanpai/jiangpin.psd" target="_blank">点击下载模版</a></span>
                        </div>
                    </div> 
                    <div class="form-group display">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>中奖后的提示</label>
                        <div class="col-sm-8 col-xs-12">
                           {php echo view_form_field_image('giftimg2',$gift['giftimg2']);}
                        <span class="help-block">像素472*638 <a style="color: #000000" href="https://css2019.yixuan.net/2019css/fanpai/zhongjiang.psd" target="_blank">点击下载模版</a></span>
                        </div>
                    </div>
                {else}
                    <div class="form-group display">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>前端图片</label>
                        <div class="col-sm-8 col-xs-12">
                           {php echo view_form_field_image('giftimg',$gift['giftimg']);}
                        <span class="help-block">所有图片需要一样大小</span>
                        </div>
                    </div>  
                {/if}
                 {if $system['friend']==1}
                    <div class="form-group display">
                        <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"><span style='color:red'>*</span>带有兑换按扭的图片</label>
                        <div class="col-sm-8 col-xs-12">
                           {php echo view_form_field_image('giftimg2',$gift['giftimg2']);}
                        <span class="help-block">所有图片需要一样大小</span>
                        </div>
                    </div>
                {/if}
                {if $system['fanpai']==1}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">中奖率</label>
                    <div class="col-sm-6 col-xs-12">                        
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="" name="zhongjianglv" value="{$gift['zhongjianglv']}">
                            <span class="input-group-addon">%</span>
                        </div>
                        <span class="help-block">中奖率百分比，中奖率为0则不会被抽中</span>
                        <span class="help-block">翻牌抽奖模式下，中奖率越高则会先被抽中，中奖率相同随机抽</span>
                    </div>
                </div>
                 {/if}
             {if $system['friend']==1}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">兑换值</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="duihuan" value="{$gift['duihuan']}">
                        <span class="help-block">多少积分可以兑换此礼品</span>
                    </div>
                </div> 
            {/if}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">库存</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="stock" value="{$gift['stock']}">
                        <span class="help-block">默认为10000个，当库存不够时，前端自动隐藏兑换</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">是否启用</label>
                    <div class="col-sm-8 col-xs-12">
                    <label class="checkbox">
                      <input type="checkbox" name="state" value="1" {if $gift['state'] != 0}checked="checked"{/if}>勾选则表示启用
                    </label>
                     </div>
                </div> 

        </div>
    </div>

    {if $system['fenxiao07']==1}
    <div class="panel panel-default">
        <div class="panel-heading">摇一摇礼品专用</div>
        <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">价值</label>
                    <div class="col-sm-6 col-xs-12">                        
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="" name="giftjiazhi" value="{$gift['giftjiazhi']}">
                            <span class="input-group-addon">元</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">支付价格</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="price" value="{$gift['price']}">
                        <span class="help-block">单位元,可不填，商城模式需要填</span>
                    </div>
                </div>    
        </div>
    </div>
    {/if}

    <div class="form-group">
        <div class="col-sm-12">
            <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
            <input type="hidden" name="__token__" value="{$Request.token}" />
        </div>
    </div>
</form>
</div>

